package threadSafe.map;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ThreadTest {
	public static void main(String[] args) {
		
		Runnable runnable = new Runnable() {
			//多个线程使用一个属性值
			MapTest count = new MapTest();
			Map map = new ConcurrentHashMap<>();
			public void run() {
			//每个线程都new	MapTest count = new MapTest();
				//count.testMap();
				count.testMap(map);
			}
		};
		for (int i = 0; i < 10; i++) {
			new Thread(runnable).start();
		}
	}
}